package rpg.data
{
	import rpg.Utils.GameUtils;
	import rpg.Utils.Val;

	public class HeroData extends GameData
	{

		public var spellArray : Array;

		/**
		 * 职业类别
		 */
		public var race : int;

		public var teamID : int = Val.TEAM_FRIEND;

		public var baseState : SpriteStat;

		public function HeroData()
		{
			initData();
		}

		private function initData() : void
		{
			baseState = new SpriteStat();
			baseState.stepTime = 300;
			maxHP = 100;
				currHP = 100;
		}

		public function get speed() : Number
		{
			return Number(Number(GameUtils.GRID_WIDTH / stepTime).toFixed(2));
		}

		public function get stepTime() : int
		{
			return baseState.stepTime;
		}

		public function get currHP() : int
		{
			return baseState.currHP;
		}

		public function set currHP(value : int) : void
		{
			baseState.currHP = value;
			if(baseState.currHP > baseState.maxHP)
				baseState.currHP = baseState.maxHP;
		}

		public function get maxHP() : int
		{
			return baseState.maxHP;
		}

		public function set maxHP(value : int) : void
		{
			baseState.maxHP = value;
		}


	}
}